package com.kk.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashSet;
import java.util.Set;

/**
 * @author: kevin
 * @data: 2018-08-28 00:11
 * @desc:
 */
public class SetUtils {
    private static Logger log = LoggerFactory.getLogger(SetUtils.class);
    public static <T> Set<T> addAll(T... vars) {
        Set<T> sets = new HashSet<>();
        for (T t : vars) {
            if (t != null) {
                try {
                    sets.add(t);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            } else {
                log.error("存在对象为空",t);
                return null;
            }
        }
        return sets;
    }

}
